﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace EITSurferInfinityLib
{
    public class LogsWR
    {
        string FileName;

        public LogsWR(string name)
        {
            FileStream fs = File.Open(name, FileMode.OpenOrCreate);
            fs.Close();
            FileName = name;
        }

        public void Add(string txt)
        {
            try
            {
                FileStream fs = File.Open(FileName, FileMode.Append, FileAccess.Write);
                StreamWriter sw = new StreamWriter(fs);
                string tmp = txt.Replace("\r", "\n");
                tmp = tmp.Replace("\n", "\r\n") + "\r\n";
                tmp = tmp.Replace("\r\n\r\n", "\r\n");
                sw.Write(tmp);
                sw.Close();
                fs.Close();
            }
            catch (Exception e)
            {
            }
        }
    }
}
